PATHMac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Window Manager >

Programming With the Mac OS 8.5 Window Manager


ResizeWindow

Handles all user interaction while a window is being resized.

pascal Boolean ResizeWindow (
                     WindowPtr window,
                     Point startPoint,
                     const Rect *sizeConstraints,
                     Rect *newContentRect);
window
A value of type WindowPtr . Pass a pointer to the window to be resized.
startPt
A structure of type Point . Before calling ResizeWindow , your application should set the Point structure to contain the location, specified in global coordinates, where the mouse-down event occurred. Your application may retrieve this value from the where field of the event structure.
sizeConstraints
A pointer to a structure of type Rect . Before calling ResizeWindow , set the rectangle to specify the limits on the vertical and horizontal measurements of the content rectangle, in pixels. Although this parameter gives the address of a structure that is in the form of the Rect data type, the four numbers in the structure represent limits, not screen coordinates. The top , left , bottom , and right fields of the structure specify the minimum vertical measurement ( top ), the minimum horizontal measurement ( left ), the maximum vertical measurement ( bottom ), and the maximum horizontal measurement ( right ). The minimum dimensions should be large enough to allow a manageable rectangle; 64 pixels on a side is typical. The maximum dimensions can be no greater than 32,767. You can pass NULL to allow the user to resize the window to any size that is contained onscreen.
newContentRect
A pointer to a structure of type Rect . On return, the structure contains the new dimensions of the window's content region, in global coordinates.
function result
A value of type Boolean . The function returns true if the window was successfully resized; otherwise, false .
DISCUSSION

The ResizeWindow function moves an outline (grow image) of the window's edges around the screen, following the user's cursor movements, and handles all user interaction until the mouse button is released. Unlike with the function GrowWindow , there is no need to follow this call with a call to the function SizeWindow , because once the mouse button is released, ResizeWindow resizes the window if the user has changed the window size. Once the resizing is complete, ResizeWindow draws the window in the new size.

Your application should call the ResizeWindow function instead of the earlier Window Manager functions SizeWindow and GrowWindow . Some appearances may allow the window to be resized from any corner, not just the bottom right, and as a result, when the user resizes the window, the window may move on the screen and not merely change size. ResizeWindow informs your application of the new window bounds, so that your application can respond to any changes in the window's position.

VERSION NOTES

Supported with Mac OS 8.6 and later.


© 1999 Apple Computer, Inc. – (Last Updated 18 March 99)